/**
 * @author  zhanshi Liu
 * @date    2020/04/15
 * @website www.jhmsona.cn
 */
var vm = new Vue({
    el:'#vm',
    data:{
        tableData:[],
        currentPage:1,
        count:0,
        operData:{},
        title:undefined,
        dialogFormVisible: false,
        formLabelWidth: '80px',
        form:{
            visitName:undefined,
            visitIp:undefined,
            page:1,
            limit:10,
        }
    },
    created:function (){
        this.getLogs();
    },
    mounted:function(){

    },
    methods:{
        getLogs(){
            $.ajax({
                url:'/log/oper/list',
                type:'get',
                dataType:"json",
                data:{
                    data:JSON.stringify(this.form)
                },
                success:(res)=>{
                    this.tableData = res.data;
                    this.count=res.count;
                }
            })
        },
        selectionChange(val){//多选
            this.roleIds = val.map(item => item.roleId);
        },
        search(){
            this.getLogs();
        },
        reset(form1){
            this.$refs[form1].resetFields()
        },
        handleSizeChange(val) {
            this.form.limit = val;
            this.getLogs();
        },
        handleCurrentChange(val) {
            this.form.page = val;
            this.getLogs();
        },
        detail(row){
            this.title="操作明细";
            this.dialogFormVisible=true;
            axios.get('/log/oper/info',{
                params:{
                    operId:row.operId
                }
            }).then(res=> {
                console.log(res);
                this.operData = res.data.data;
            })
        }
    }
})

